<%@ page language="java" import="java.util.*, web_package.ScalaCaller, db.*" contentType="text/html; charset=windows-1255"
    pageEncoding="windows-1255"%>
<%@ page session="true" %>
<% session.setAttribute("folderID",request.getParameter("fold")); %>
<jsp:useBean id="user" class="db.User" scope="session"></jsp:useBean>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
body {
	background-color: #FFFFFF;
	background-image: url(images/stripe.png);
	background-repeat: repeat-y;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
</style>
<link href="CSS/layout.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="wrapper">
  <div id="logo"> <img src="images/logo.png" alt="mybox" width="650" height="100" /> </div>
  	<div id="bodyArea">
  		<div id="left">
        	<div id="header">Hello <%=user.getFirstName() %>! </div>
            <div id="link">
            	<a href="">Edit my details</a>
            </div>
            <div id="signout">
            	<a href="">log out</a>
            </div>
            <div id="link2"><a href="">Download <br />
								Clever Dropbox <br />
								to your Computer </a>
			</div>
        </div>
  		<div id="right">
  		<% LinkedList<Folder> folders = ScalaCaller.getFolders(user.getUserID(), (Long)session.getAttribute("folderID"));  
  			for(int i=0; i<folders.size(); i++){ %>
        	<div id="folder">
       	    <img src="images/folder_24.png" width="24" height="24" alt="folder" />
       	     <%= folders.get(i).getFolderName() %>
            <input type="button" value="view" onselect="folder.jsp?fold=<%=folders.get(i).getFolderID()%>"/>
            </div>
            <%}
  		%>
        <% LinkedList<File> files = ScalaCaller.getFiles(user.getUserID(), (Long)session.getAttribute("folderID"));
	         for(int i=0; i<folders.size(); i++){ %>
	     	<div id="folder">
	    	    <img src="images/file.png" width="24" height="24" alt="folder" />
	    	     <%= files.get(i).getFileName() %>
	         <input type="button" value="download" onselect=""/>
	         </div>
	         <%} 
	    %>
        </div>
  	</div>
  	<div id="footer"></div>
</div>
</body>
</html>
